package com.djicorp.rm.web.api.facade;

import com.djicorp.rm.web.api.entity.UserInfo;
import com.djicorp.rm.web.api.service.IUserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserConroller {

    @Resource
    private IUserService userService;

    @PostMapping("/addUser")
    public Long addUser(@RequestBody UserInfo userInfo){
        return userService.addUser(userInfo);
    }

    @PostMapping("/updateUser")
    public Long updateUser(@RequestBody UserInfo userInfo){
        return userService.updateUser(userInfo);
    }

    @PostMapping("/deleteUser")
    public Long deleteUser(@RequestBody UserInfo userInfo){
        return userService.deleteUser(userInfo);
    }
}
